import java.io.FileWriter;
import java.io.IOException;

public class FileCharWriter {
    public static void main(String[] args) {
        try {
            FileWriter writer = new FileWriter("char_file.txt");

            writer.write('s');
            writer.write("在什么样的花园里挖呀挖");
            // 换行
            writer.write('\n');

            // 写入整个数组
            char[] temp = {'在', '小', '小', '的', '花', '园', '里', '挖', '呀', '挖'};
            writer.write(temp);
            // 输入部分数组内容
            char[] mini = {'种', '小', '小', '的', '种', '子', '开', '小', '小', '的', '花'};
            writer.write(mini, 6, 5);

            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
